import os
import shutil
import sys

src = sys.argv[1]
dst = sys.argv[2]

if not src or not dst:
    print("providing src and dst")
    exit

def f(root_path):
    for dir_file in os.listdir(root_path):
        dir_file_path = os.path.join(root_path, dir_file)
        if os.path.isdir(dir_file_path):
            f(dir_file_path)
        else:
            cmd = f"mv {dir_file_path} {dst}/"
            print(f"Executing {cmd}...")
            os.system(cmd)

if __name__ == '__main__':
    os.system(f"mkdir -p {dst}")
    f(src)
